package com;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.Output;
import org.springframework.cloud.stream.messaging.Source;
import org.springframework.integration.support.MessageBuilder;
import org.springframework.messaging.MessageChannel;

@EnableBinding(Source.class)
public class MsgSender {

	@Autowired
    @Output(Source.OUTPUT)
    private MessageChannel channel;
 
    public void send(String msg) {
    	Integer val = Integer.valueOf(msg); 
    	
        //channel.send(MessageBuilder.withPayload(msg).build());
    	channel.send(MessageBuilder.withPayload(val).build());
    }
}
